﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace XXVIII.Api.Models
{

    /// <summary>
    /// 创建表结构
    /// </summary>
    public class GeneralCreateTableRequest
    {
        /// <summary>
        /// 表名
        /// </summary>
        public string TableName { get; set; }

        /// <summary>
        /// 字段属性
        /// </summary>
        public List<CreateCloumnRequest> Columns { get; set; }
    }

    /// <summary>
    /// 单条 列属性
    /// </summary>
    public class CreateCloumnRequest
    {
        /// <summary>
        /// 字段名称  
        /// </summary>
        public string ColumnName { get; set; }

        /// <summary>
        /// 字段类型
        /// </summary>
        public string ColumnType { get; set; }


        /// <summary>
        /// 是否允许为空
        /// </summary>
        public bool IsNULL { get; set; }


        /// <summary>
        /// 是否为主键
        /// </summary>
        public bool IsKey { get; set; }


        /// <summary>
        /// 是否是自增
        /// </summary>
        public bool IsIdentity { get; set; }


        /// <summary>
        /// 默认值
        /// </summary>
        public string DefualtValue { get; set; }

        /// <summary>
        /// 字段描述(中文显示名称)
        /// </summary>
        public string Describe { get; set; }


        /// <summary>
        /// 长度
        /// </summary>
        public int Length { get; set; }

        /// <summary>
        /// decimal的小数 长度
        /// </summary>
        public int DecimalLength { get; set; }

        /// <summary>
        /// 自增 种子
        /// </summary>
        public int IdentitySeed { get; set; }

        /// <summary>
        /// 自增 增量
        /// </summary>
        public int IdentityIncrement { get; set; }

    }


    public class GeneralTablePropertyRequest
    {
        /// <summary>
        /// 表名
        /// </summary>
        public string TableName { get; set; }
    }
}